package com.example.activitylifedemo

import android.content.Intent
import android.support.v7.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import kotlinx.android.synthetic.main.activity_third.*

class ThirdActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_third)
        Log.d("ActivityLife==>", "ThirdActivity,onCreate)")
        btn_main_activity.setOnClickListener {
            startActivity(Intent(ThirdActivity@ this, MainActivity::class.java))
        }
        btn_second_activity.setOnClickListener {
            startActivity(Intent(ThirdActivity@ this, SecondActivity::class.java))
        }
    }

    override fun onResume() {
        super.onResume()
        Log.d("ActivityLife==>", "ThirdActivity,onResume()")
    }

    override fun onStart() {
        super.onStart()
        Log.d("ActivityLife==>", "ThirdActivity,onStart()")
    }

    override fun onPause() {
        super.onPause()
        Log.d("ActivityLife==>", "ThirdActivity,onPause()")
    }

    override fun onStop() {
        super.onStop()
        Log.d("ActivityLife==>", "ThirdActivity,onStop()")
    }

    override fun onDestroy() {
        super.onDestroy()
        Log.d("ActivityLife==>", "ThirdActivity,onDestroy()")
    }

    override fun onRestart() {
        super.onRestart()
        Log.d("ActivityLife==>", "ThirdActivity,onRestart()")
    }
}
